from scapy.all import *

def region_growing(rulebound,sign,maxcost):
    p = {}
    ibound = {}
    samplecount = 0
    samplesign = sign
    while samplesign*sign > 0 and samplecount < maxcost:
        pkt = select_core()
        samplecount = samplecount+1
        comm.inject_pkt(pkt)
        samplesign = comm.sign_of_last_pkt()
    if samplecount >maxcost:
        return p
    dimension = getpktdimension(pkt)
    imax = findmaxbound(pkt,dimension) 
    imin = findminbound(pkt,dimension)
    for i in range(0,len(imax)):
        ibound[dimension[i]] = (imin[i],imax[i])
    p{ibound} = -sign
    leftcost = (maxcost -samplecount)/(2d+1) 



 
    pass

def select_core():
    pass
  